#
FROM postgres:latest

USER postgres

#来自官方文档:https://hub.docker.com/_/postgres/
#How to extend this image
#If you would like to do additional initialization in an image derived from this one, 
# add one or more *.sql, *.sql.gz, or *.sh scripts under /docker-entrypoint-initdb.d (creating the directory if necessary). 
# After the entrypoint calls initdb to create the default postgres user and database, 
# it will run any *.sql files and source any *.sh scripts found in that directory to do further initialization before starting the service.
#Additionally, as of docker-library/postgres#253, 
# these initialization scripts are run as the postgres user 
# (or as the "semi-arbitrary user" specified with the --user flag to docker run; see the section titled "Arbitrary --user Notes" for more details).
#You can also extend the image with a simple Dockerfile to set a different locale. The following example will set the default locale to de_DE.utf8:

COPY init.sh /docker-entrypoint-initdb.d/

